﻿using System;
using System.Globalization;
using System.Reflection;

namespace _53_typeof运算符的作用_运算符
{
    class Program
    {
        static void Main(string[] args)
        {
            Type t = typeof(Person);

            Console.WriteLine($"完整类：{t.FullName}");
            Console.WriteLine("是否为抽象类{0}", t.IsAbstract ? "是" : "否");
            Console.WriteLine("是否为公共类：{0}", t.IsPublic ? "是" : "否");
            Console.WriteLine("是否为嵌套类：{0}", t.IsNestedPublic ? "是" : "否");

            //获取属性列表
            PropertyInfo[] props = t.GetProperties(BindingFlags.Public | BindingFlags.Instance);
            Console.WriteLine("\n\n ------ 属性列表 ------");
            foreach (var p in props)
            {
                Console.WriteLine($"{p.Name,-15}{p.PropertyType.Name,-15}");
            }
            Console.Read();       
        }
    }

    public abstract class Person
    {
        public abstract int Age { get; set; }
    }

}
